#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
#include<string>
using namespace std;

class Solution {
public:
    int numberOfPoints(vector<vector<int>>& nums) {
        int mp[101] = { 0 }, ans = 0;
        for (int i = 0; i < nums.size(); ++i)
        {
            for (int j = nums[i][0]; j <= nums[i][1]; ++j)
            {
                ++mp[j];
            }
        }
        for (int n : mp)
        {
            if (n != 0) ++ans;
        }
        return ans;
    }

    string modifyString(string s) {
        int n = s.size();
        for (int i = 0; i < n; ++i)
        {
            if (s[i] == '?')
            {
                for (char c = 'a'; c <= 'z'; ++c)
                {
                    if ((i == 0 || c != s[i - 1]) && (i == n - 1 || c != s[i + 1]))
                    {
                        s[i] = c;
                        break;
                    }
                }
            }
        }
        return s;
    }

    struct TreeNode {
        int val;
        TreeNode* left;
        TreeNode* right;
        TreeNode() : val(0), left(nullptr), right(nullptr) {}
        TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
        TreeNode(int x, TreeNode* left, TreeNode* right) : val(x), left(left), right(right) {}
        
    };

    string tree2str(TreeNode* root) {
        string res;
        if (root == nullptr) return res;
        res += to_string(root->val);
        if (root->left || root->right)
        {
            res += '(';
            res += tree2str(root->left);
            res += ')';
        }
        if (root->right)
        {
            res += '(';
            res += tree2str(root->right);
            res += ')';
        }
        return res;
    }
};

class A
{
public:
    virtual void func() { cout << "A" << endl; }
};

class B :public A
{
public:
    void func() { cout << "B" << endl; }
};

class Animal
{
public:
    virtual void talk() const {};
};

class Cat:public Animal
{
public:
    void talk() const { cout << "cat" << endl; }
};

class Dog:public Animal
{
public:
    void talk() const { cout << "dog" << endl; }
};

void letsHear(Animal& a)
{
    a.talk();
}

int main()
{
    /*A* a = new(A);
    A* b = new(B);
    a->func();
    b->func();*/
    Cat cat;
    Dog dog;
    letsHear(cat);
    letsHear(dog);
    return 0;
}